Skip to content

Conversation

@juliusgeo
Copy link
Contributor

No description provided.

@juliusgeo juliusgeo marked this pull request as ready for review May 25, 2022 00:25
@juliusgeo juliusgeo requested a review from blink1073 as a code owner May 25, 2022 00:25
@juliusgeo juliusgeo requested a review from ShaneHarvey May 25, 2022 04:27
Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to test with the csfle library and retain the existing mongocryptd tests. There are a few options:

  1. create new EVG tasks that runs test_encryption with auto-loaded csfle.
  2. duplicate the tests programmatically, run one set without csfle and one set with csfle_path.
  3. do what we did in pymongocrypt's testing and run setup.py test twice.

I like option 2 the best since it makes it makes the EVG test logs easier to reason about without bloating the test matrix.

Edit: After talking offline we decided that option 1) is better.

class TestBypassSpawningMongocryptdProse(EncryptionIntegrationTest):
@unittest.skipIf(
os.environ.get("TEST_CSFLE"),
"this prose test does not work when CSFLE is " "on a system dynamic library search path.",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.rst#8-bypass-spawning-mongocryptd
The note at the top says that you cannot run this test unless you disable CSFLE. The only way to disable CSFLE is to both not specify csfle_path and make sure CSFLE is not on any search paths. When TEST_CSFLE is specified, CSFLE is definitely on the search path, so we have to skip.

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work so far!

if [ -z $TEST_CSFLE ]; then
echo "CSFLE not being tested"
else
git clone git@github.com:mongodb-labs/drivers-evergreen-tools.git
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drivers-evergreen-tools is already cloned into $DRIVERS_TOOLS, eg:

$PYTHON $DRIVERS_TOOLS/.evergreen/mongodl.py ...

@unittest.skipUnless(os.environ.get("TEST_CSFLE"), "csfle is not installed")
def test_csfle(self):
# Test that we can pick up csfle automatically
MongoClient(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need to close this client to clean up pymongocrypt resources.

tasks: *encryption-server-versions
display_name: "Encryption ${platform} ${auth} ${ssl} ${encryption}"
tasks: &encryption-server-versions
- ".latest"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add 6.0 and rapid.

- ".5.0"
- ".4.4"
- ".4.2"
- ".4.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we don't want to test CSFLE with <6.0 we should use the "rules" field to ensure we're only testing classic fle with 4.0+ and shared lib fle with 6.0+: https://github.com/evergreen-ci/evergreen/wiki/Project-Configuration-Files#the-rules-field

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a rules field but it does not seem to be removing the tasks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to a longstanding bug in EVG, the if condition needs to have all matrix axis in it:

  rules:
    - if:
        platform: "*"
        auth: "*"
        ssl: "*"
        encryption: [ "encryption_with_csfle" ]
      then:...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is now working for mac os, but not for the other platforms.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other ones have different axis.

vars:
VERSION: "6.0"
TOPOLOGY: "sharded_cluster"
- func: "run tests"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already added 6.0 testing a while back. Why is this showing up here? Can we git merge master and fix the merge conflicts?

- ".5.0"
- ".4.4"
- ".4.2"
- ".4.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other ones have different axis.

@juliusgeo juliusgeo requested a review from ShaneHarvey May 26, 2022 21:38
Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, waiting for this patch to succeed testing the shared library on all server versions on all platforms: https://spruce.mongodb.com/version/628ff72b56234342524f04d3

@juliusgeo juliusgeo changed the title PYTHON-3081 FLE 1.0 Shared Library PYTHON-3276 [pymongo] FLE 1.0 shared library May 27, 2022
@juliusgeo juliusgeo merged commit f4fc742 into mongodb:master May 27, 2022
juliusgeo added a commit to juliusgeo/mongo-python-driver that referenced this pull request Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants